#include <bits/stdc++.h>
using namespace std;
int n, m;
const int N = 1010;
int f[N][N];
int v[N], w[N], g[N];

int main() {
	cin >> n >> m;
	for (int i = 1; i <= n; ++i) {
		cin >> v[i] >> w[i] >> g[i];
	}
	f[0][0] = 0;
	for (int i = 1; i <= n; ++i) {
		for (int j = 0; j <= m; ++j) {
			for (int k = 0)
			}
	}
	return 0;
}